dependencies = [
"advapi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.55 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.56 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "flate2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"git2-curl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"registry 0.1.0",
"rustc-serialize 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"threadpool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "curl-sys 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "curl-sys"
-version = "0.1.17"
+version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "docopt"
-version = "0.6.55"
+version = "0.6.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "flate2"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libgit2-sys"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "tar"
-version = "0.2.6"
+version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[package]]
name = "term"
-version = "0.2.3"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
use std::collections::HashSet;
use std::collections::hash_map::HashMap;
-use std::collections::hash_map::Entry::{Occupied, Vacant};
use core::{Source, SourceId, SourceMap, Summary, Dependency, PackageId, Package};
use util::{CargoResult, ChainError, Config, human, profile};
}
pub fn register_lock(&mut self, id: PackageId, deps: Vec<PackageId>) {
- let sub_map = match self.locked.entry(id.source_id().clone()) {
- Occupied(e) => e.into_mut(),
- Vacant(e) => e.insert(HashMap::new()),
- };
- let sub_vec = match sub_map.entry(id.name().to_string()) {
- Occupied(e) => e.into_mut(),
- Vacant(e) => e.insert(Vec::new()),
- };
+ let sub_map = self.locked.entry(id.source_id().clone())
+ .or_insert(HashMap::new());
+ let sub_vec = sub_map.entry(id.name().to_string())
+ .or_insert(Vec::new());
sub_vec.push((id, deps));
}
use std::cell::RefCell;
use std::collections::HashSet;
use std::collections::hash_map::HashMap;
-use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::fmt;
use std::rc::Rc;
use semver;
spec: &PackageIdSpec) {
let mut version_cnt = HashMap::new();
for id in ids.iter() {
- match version_cnt.entry(id.version()) {
- Vacant(e) => { e.insert(1); }
- Occupied(e) => *e.into_mut() += 1,
- }
+ *version_cnt.entry(id.version()).or_insert(0) += 1;
}
for id in ids.iter() {
if version_cnt[id.version()] == 1 {
// Record what list of features is active for this package.
if used_features.len() > 0 {
let pkgid = parent.package_id();
- match cx.resolve.features.entry(pkgid.clone()) {
- Occupied(entry) => entry.into_mut(),
- Vacant(entry) => entry.insert(HashSet::new()),
- }.extend(used_features.into_iter());
+ cx.resolve.features.entry(pkgid.clone())
+ .or_insert(HashSet::new())
+ .extend(used_features);
}
Ok(ret)
match parts.next() {
Some(feat) => {
let package = feat_or_package;
- match deps.entry(package.to_string()) {
- Occupied(e) => e.into_mut(),
- Vacant(e) => e.insert(Vec::new()),
- }.push(feat.to_string());
+ deps.entry(package.to_string())
+ .or_insert(Vec::new())
+ .push(feat.to_string());
}
None => {
let feat = feat_or_package;
}
}
None => {
- match deps.entry(feat.to_string()) {
- Occupied(..) => {} // already activated
- Vacant(e) => { e.insert(Vec::new()); }
- }
+ deps.entry(feat.to_string()).or_insert(Vec::new());
}
}
visited.remove(&feat.to_string());
}
#[cfg(windows)]
fn isatty(fd: libc::c_int) -> bool {
- extern crate kernel32_sys as kernel32;
+ extern crate kernel32;
extern crate winapi;
unsafe {
let handle = kernel32::GetStdHandle(if fd == libc::STDOUT_FILENO {
-use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::fs::{self, File, OpenOptions};
use std::io::prelude::*;
use std::io::{BufReader, SeekFrom};
cx.compilation.binaries.push(dst);
} else if target.is_lib() {
let pkgid = pkg.package_id().clone();
- match cx.compilation.libraries.entry(pkgid) {
- Occupied(entry) => entry.into_mut(),
- Vacant(entry) => entry.insert(Vec::new()),
- }.push(dst);
+ cx.compilation.libraries.entry(pkgid).or_insert(Vec::new())
+ .push(dst);
}
}
}
use std::collections::HashSet;
use std::collections::hash_map::HashMap;
-// use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::sync::mpsc::{channel, Sender, Receiver};
use threadpool::ThreadPool;
let mut my_dependencies = HashSet::new();
for dep in key.dependencies(cx).into_iter() {
assert!(my_dependencies.insert(dep.clone()));
- let rev = match self.reverse_dep_map.entry(dep) {
- Occupied(entry) => entry.into_mut(),
- Vacant(entry) => entry.insert(HashSet::new()),
- };
+ let rev = self.reverse_dep_map.entry(dep).or_insert(HashSet::new());
assert!(rev.insert(key.clone()));
}
&mut slot.insert((my_dependencies, value)).1
use std::fmt;
use std::hash::Hash;
-use std::collections::hash_set::HashSet;
+use std::collections::hash_set::{HashSet, Iter};
use std::collections::hash_map::{HashMap, Keys};
-use std::collections::hash_map::Entry::{Occupied, Vacant};
-use std::collections::hash_set::Iter;
pub struct Graph<N> {
nodes: HashMap<N, HashSet<N>>
}
pub fn link(&mut self, node: N, child: N) {
- match self.nodes.entry(node) {
- Occupied(entry) => entry.into_mut(),
- Vacant(entry) => entry.insert(HashSet::new()),
- }.insert(child);
+ self.nodes.entry(node).or_insert(HashSet::new()).insert(child);
}
pub fn get_nodes(&self) -> &HashMap<N, HashSet<N>> {
#[cfg(windows)]
mod imp {
extern crate winapi;
- extern crate advapi32_sys as advapi32;
+ extern crate advapi32;
use std::io;
use std::ptr;